#include "fcalculatrice.h"
#include "ui_fcalculatrice.h"

FCalculatrice::FCalculatrice(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::FCalculatrice)
{
    ui->setupUi(this);
    //limiter la saisie dans l'affichage pile et resultat
    ui->pile->setReadOnly(true);
    
    connect(ui->efface, SIGNAL(clicked()),ui->line_saisie,SLOT(clear()));
    connect(ui->chiffre9, SIGNAL(clicked()),this, SLOT(s9()));
    connect(ui->chiffre8, SIGNAL(clicked()),this, SLOT(s8()));
    connect(ui->chiffre7, SIGNAL(clicked()),this, SLOT(s7()));
    connect(ui->chiffre6, SIGNAL(clicked()),this, SLOT(s6()));
    connect(ui->chiffre5, SIGNAL(clicked()),this, SLOT(s5()));
    connect(ui->chiffre4, SIGNAL(clicked()),this, SLOT(s4()));
    connect(ui->chiffre3, SIGNAL(clicked()),this, SLOT(s3()));
    connect(ui->chiffre2, SIGNAL(clicked()),this, SLOT(s2()));
    connect(ui->chiffre1, SIGNAL(clicked()),this, SLOT(s1()));
    connect(ui->chiffre0, SIGNAL(clicked()),this, SLOT(s0()));
    connect(ui->addition, SIGNAL(clicked()),this, SLOT(sAdd()));
    connect(ui->soustraction, SIGNAL(clicked()),this, SLOT(sSous()));
    connect(ui->multiplication, SIGNAL(clicked()),this, SLOT(sMult()));
    connect(ui->division, SIGNAL(clicked()),this, SLOT(sDiv()));
    connect(ui->virgule, SIGNAL(clicked()),this, SLOT(sVirg()));
    connect(ui->dollar, SIGNAL(clicked()),this, SLOT(sDollar()));
    connect(ui->swap,  SIGNAL(clicked()),this, SLOT(sSwap()));
    connect(ui->dup,  SIGNAL(clicked()),this, SLOT(sDup()));
    connect(ui->drop,  SIGNAL(clicked()),this, SLOT(sDrop()));
    connect(ui->clear,  SIGNAL(clicked()),this, SLOT(sClear()));
    connect(ui->mod,  SIGNAL(clicked()),this, SLOT(sMod()));
    connect(ui->log,  SIGNAL(clicked()),this, SLOT(sLog()));
    connect(ui->cube,  SIGNAL(clicked()),this, SLOT(sCube()));
    connect(ui->pow,  SIGNAL(clicked()),this, SLOT(sPow()));
    connect(ui->sqrt,  SIGNAL(clicked()),this, SLOT(sSqrt()));
    connect(ui->sqr,  SIGNAL(clicked()),this, SLOT(sSqr()));
    connect(ui->ln,  SIGNAL(clicked()),this, SLOT(sLn()));
    connect(ui->sign,  SIGNAL(clicked()),this, SLOT(sSign()));
    connect(ui->facto,  SIGNAL(clicked()),this, SLOT(sFacto()));
    connect(ui->sinh,  SIGNAL(clicked()),this, SLOT(sSinh()));
    connect(ui->cosh,  SIGNAL(clicked()),this, SLOT(sCosh()));
    connect(ui->tanh,  SIGNAL(clicked()),this, SLOT(sTanh()));
    connect(ui->sin,  SIGNAL(clicked()),this, SLOT(sSin()));
    connect(ui->cos,  SIGNAL(clicked()),this, SLOT(sCos()));
    connect(ui->tan,  SIGNAL(clicked()),this, SLOT(sTan()));
    connect(ui->inv,  SIGNAL(clicked()),this, SLOT(sInv()));
    connect(ui->exp,  SIGNAL(clicked()),this, SLOT(sExp()));
    connect(ui->espace,  SIGNAL(clicked()),this, SLOT(sEspace()));
    connect(ui->back,  SIGNAL(clicked()),this, SLOT(sBack()));
    connect(ui->actionQuitter, SIGNAL(activated()),this, SLOT(close()));
    
}

FCalculatrice::~FCalculatrice()
{
    delete ui;
}
